<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>对象的声明</title>
  <script type="text/javascript">
    const name = "tom";
    const age = 18;
    // 传统声明对象
    let person = {name: name, age: age};
    console.log("person:", person);
    // ES6声明对象简化
    // 属性名需为之前声明过的常量/变量, 声明后的属性值为常量值/最近的变量值
    let person2 = {name, age};
    console.log("person2:", person2);
  </script>
</head>
<body>
</body>
</html>
